package com.tenement.mybatis.entity;

import java.io.Serializable;

public class User implements Serializable {
	private Integer uId;

	private String uEmail;

	private String uTelephone;

	private String uPassword;

	private String uNickname;

	private Integer uLandlord;

	private String uPhotoUrl;

	private String uPhotoName;

	private static final long serialVersionUID = 1L;

	public User() {
		super();
	}

	/**
	 * 注册，只能用手机号进行注册
	 * 
	 * @param uTelephone
	 * @param uPassword
	 */
	public User(String uTelephone, String uPassword, String uNickname) {
		super();
		this.uTelephone = uTelephone;
		this.uPassword = uPassword;
		this.uNickname = uNickname;
	}

	public Integer getuId() {
		return uId;
	}

	public void setuId(Integer uId) {
		this.uId = uId;
	}

	public String getuEmail() {
		return uEmail;
	}

	public void setuEmail(String uEmail) {
		this.uEmail = uEmail == null ? null : uEmail.trim();
	}

	public String getuTelephone() {
		return uTelephone;
	}

	public void setuTelephone(String uTelephone) {
		this.uTelephone = uTelephone == null ? null : uTelephone.trim();
	}

	public String getuPassword() {
		return uPassword;
	}

	public void setuPassword(String uPassword) {
		this.uPassword = uPassword == null ? null : uPassword.trim();
	}

	public String getuNickname() {
		return uNickname;
	}

	public void setuNickname(String uNickname) {
		this.uNickname = uNickname == null ? null : uNickname.trim();
	}

	public Integer getuLandlord() {
		return uLandlord;
	}

	public void setuLandlord(Integer uLandlord) {
		this.uLandlord = uLandlord;
	}

	public String getuPhotoUrl() {
		return uPhotoUrl;
	}

	public void setuPhotoUrl(String uPhotoUrl) {
		this.uPhotoUrl = uPhotoUrl == null ? null : uPhotoUrl.trim();
	}

	public String getuPhotoName() {
		return uPhotoName;
	}

	public void setuPhotoName(String uPhotoName) {
		this.uPhotoName = uPhotoName == null ? null : uPhotoName.trim();
	}

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		User other = (User) that;
		return (this.getuId() == null ? other.getuId() == null : this.getuId().equals(other.getuId()))
				&& (this.getuEmail() == null ? other.getuEmail() == null : this.getuEmail().equals(other.getuEmail()))
				&& (this.getuTelephone() == null ? other.getuTelephone() == null
						: this.getuTelephone().equals(other.getuTelephone()))
				&& (this.getuPassword() == null ? other.getuPassword() == null
						: this.getuPassword().equals(other.getuPassword()))
				&& (this.getuNickname() == null ? other.getuNickname() == null
						: this.getuNickname().equals(other.getuNickname()))
				&& (this.getuLandlord() == null ? other.getuLandlord() == null
						: this.getuLandlord().equals(other.getuLandlord()))
				&& (this.getuPhotoUrl() == null ? other.getuPhotoUrl() == null
						: this.getuPhotoUrl().equals(other.getuPhotoUrl()))
				&& (this.getuPhotoName() == null ? other.getuPhotoName() == null
						: this.getuPhotoName().equals(other.getuPhotoName()));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getuId() == null) ? 0 : getuId().hashCode());
		result = prime * result + ((getuEmail() == null) ? 0 : getuEmail().hashCode());
		result = prime * result + ((getuTelephone() == null) ? 0 : getuTelephone().hashCode());
		result = prime * result + ((getuPassword() == null) ? 0 : getuPassword().hashCode());
		result = prime * result + ((getuNickname() == null) ? 0 : getuNickname().hashCode());
		result = prime * result + ((getuLandlord() == null) ? 0 : getuLandlord().hashCode());
		result = prime * result + ((getuPhotoUrl() == null) ? 0 : getuPhotoUrl().hashCode());
		result = prime * result + ((getuPhotoName() == null) ? 0 : getuPhotoName().hashCode());
		return result;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(getClass().getSimpleName());
		sb.append(" [");
		sb.append("Hash = ").append(hashCode());
		sb.append(", uId=").append(uId);
		sb.append(", uEmail=").append(uEmail);
		sb.append(", uTelephone=").append(uTelephone);
		sb.append(", uPassword=").append(uPassword);
		sb.append(", uNickname=").append(uNickname);
		sb.append(", uLandlord=").append(uLandlord);
		sb.append(", uPhotoUrl=").append(uPhotoUrl);
		sb.append(", uPhotoName=").append(uPhotoName);
		sb.append(", serialVersionUID=").append(serialVersionUID);
		sb.append("]");
		return sb.toString();
	}
}